package com.jwgf.protocolstack;

import java.util.Comparator;

/**
 * This class is used for removing specified id in command list.
 * 
 * @author Jacky
 * 
 */
public class IdComparator implements Comparator<byte[]> {

	@Override
	public int compare(byte[] lhs, byte[] rhs) {
		// 0x30条件，防止单锭启动命令由于通讯故障，被清除，导致FunctionSet状态机，无法回到Idle状态
		if (lhs[0] == rhs[0] && lhs[1] == rhs[1] && rhs[2] != 0x30) {
			return 0;
		} else {
			return 1;
		}
	}

}
